import React from 'react';
import Header from './common/header/index'
import Home from './pages/home';
import Detail from './pages/detail';
import Login from './pages/login';
import Write from './pages/write';
import store from './store'

import { GlobalStyle } from './style'
import { IconGlobalStyle } from './static/iconfont/iconfont'
import { Provider } from 'react-redux';
import { BrowserRouter, Route } from 'react-router-dom';


class App extends React.Component {
  render() {
    return (
      <Provider store = {store}>
        <div>
          <GlobalStyle />
          <IconGlobalStyle />
          <BrowserRouter>
          <div>
            <Header />
      			<Route path='/' exact component={Home}></Route>
            <Route path='/login' exact component={Login}></Route>
            <Route path='/write' exact component={Write}></Route>
      			<Route path='/detail/:id' exact component={Detail}></Route>
      		</div>
          </BrowserRouter>
        </div>
      </Provider>
    )
  }
}
export default App;